<template>
    <div id="con">
            <div class="header">
              <div class="sys">         
                  天津市人民医院管理系统
              </div>
                 <div class="admin">
                  <div class="adminPict">
                    <img height="30px" width="30px" src="../../assets/admin.png">
                  </div>
                  <div class="adminName">
                    <el-dropdown :hide-on-click="false">
                    <span class="el-dropdown-link">
                       {{username}} <i class="el-icon-caret-bottom"></i>
                    </span>
                   <el-dropdown-menu slot="dropdown">
                      <el-dropdown-item>
                        <el-button type="text"  @click="dialogFormVisible1 = true">完善信息</el-button>
                      </el-dropdown-item>
                      <el-dropdown-item>
                        <el-button type="text"  @click="dialogFormVisible = true">修改密码</el-button>
                      </el-dropdown-item>
                      <div class="out" @click="loginOut()">               
                         <el-dropdown-item> <router-link to="/Login">退出登录</router-link></el-dropdown-item>
                      </div>
                    </el-dropdown-menu>
                  </el-dropdown>
                  </div>
               <el-dialog title="完善信息" :visible.sync="dialogFormVisible1">
                 <el-form  :model="admin1" label-width="80px" style="width:600px">
                  <el-form-item label="部门">
                    <el-select v-model="admin1.adepartid" style="width:510px">
                    <el-option v-for="depart in departs" :key="depart.ddid" :label="depart.ddname" :value="depart.ddid"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" @click="saveAdmin">保存</el-button>
                  <el-button>取消</el-button>
                </el-form-item>
              </el-form>
             
            </el-dialog>
              <div class="adminExit"> 
               <el-dialog title="修改密码" :visible.sync="dialogFormVisible">
              <el-form :model="ruleForm" :rules="rules">
                <el-form-item label="原密码" :label-width="formLabelWidth">
                  <el-input v-model="ypwd" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="新密码" :label-width="formLabelWidth"  prop="pass">
                  <el-input v-model="ruleForm.pass" autocomplete="off"></el-input>
                </el-form-item>
                 <el-form-item label="确认密码" :label-width="formLabelWidth" prop="checkPass">
                    <el-input  v-model="ruleForm.checkPass" show-password autocomplete="off"></el-input>
                 </el-form-item>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary"  @click="updateAdmin()">确 定</el-button>
              </div>
            </el-dialog>
          </div>
            <div> 
            
          </div> 
              </div>
            </div>
            <div class="main">
            <el-tabs :tab-position="tabPosition">
              
              <el-tab-pane  label="用户信息管理">
                <div class="userManage"> 
                  <table>
                  <tr>
                    <td colspan="1">编号</td>
                    <td colspan="1">姓名</td>
                    <td colspan="1">性别</td>
                    <td colspan="1">年龄</td>
                    <td colspan="1">籍贯</td>
                    <td colspan="1">注册时间</td>
                    <td colspan="1">电话</td>
                    <td colspan="1">邮箱</td>
                    <td colspan="1">信用</td>
                    <td colspan="1">禁用/开启</td>
                    <td colspan="1">&nbsp;</td>
                   </tr>
                      <tr v-for="user in users" :key="user.uuid">
                          <td colspan="1">{{user.uuid}}</td>
                          <td colspan="1">{{user.uname}}</td>
                          <td colspan="1">{{user.usex}}</td>
                          <td colspan="1">{{user.uage}}</td>
                          <td colspan="1">{{user.uaddress}}</td>
                          <td colspan="1">{{user.creatdate}}</td>
                          <td colspan="1">{{user.uphonenum}}</td>
                          <td colspan="1">{{user.uemail}}</td>
                          <td colspan="1">{{user.ucredit}}</td>
                          <td  colspan="1" >
                            <template >
                            <el-switch
                              v-model="user.ustatus"
                              @change="userFun(user)"
                              active-color="#13ce66"
                              inactive-color="#ff4949">
                            </el-switch>  
                            </template>
                          </td>
                      </tr>
                    </table>
                     <div class="pagination">
                        <el-pagination
                                background
                                @size-change="handleSizeChange"
                                @current-change="handleCurrentChange"
                                :current-page="pageConf.pageCode"
                                :page-sizes="pageConf.pageOption"
                                :page-size="pageConf.pageSize"
                                layout="total, sizes, prev, pager, next, jumper"
                                :total="pageConf.totalPage">
                        </el-pagination>
                    </div>
                  </div>
              </el-tab-pane>
              <el-tab-pane label="管理员信息管理">
                <div class="adminManage">    
                <table>
                 <tr>
                    <!-- <td>id</td> -->
                    <td>工号</td>
                    <td>姓名</td>
                    <td>部门</td>
                    <td>电话</td>
                    <td>禁用/启用</td>
                   </tr>
                      <tr v-for="admin in admins" :key="admin.aAid" >
                          <!-- {{admin}} -->
                          <td>{{admin.ajobnum}}</td>
                          <td>{{admin.aaname}}</td>
                          <td>{{admin.adepart}}</td>
                          <td>{{admin.aphonenum}}</td>
                           <!-- <td>{{admin.astatus}}</td> -->
                          <td>
                            <el-switch
                              v-model="admin.astatus"
                              @change="adminFun(admin)"
                              active-color="#13ce66"
                              inactive-color="#ff4949">
                            </el-switch>
                          </td>
                      </tr>
                    </table>
                  </div>
              </el-tab-pane>
              <el-tab-pane label="医生信息管理">
                <div class="doctorManage">
                <table>
                 <tr>           
                    <td>工号</td>
                    <td>姓名</td>
                    <td>年龄</td>
                    <td>性别</td>
                    <td>电话</td>
                    <td>籍贯</td>
                    <td>科室</td>
                    <td>主治病</td>
                    <td>职称</td>
                    <td>禁用/启用</td>
                    <td></td>
                   </tr>
                      <tr v-for="doctor in doctors" :key="doctor.dDid" >
                        <!-- {{doctor}} -->
                          <td>{{doctor.djobnum}}</td>
                          <td>{{doctor.ddname}}</td>
                          <td>{{doctor.dage}}</td>
                          <td>{{doctor.dsex}}</td>
                          <td>{{doctor.dphonenum}}</td>
                          <td>{{doctor.daddress}}</td>
                          <td>{{doctor.dkname}}</td>
                          <td>{{doctor.bbname}}</td>
                          <td>{{doctor.dtitle}}</td>
                          <td>
                            <el-switch
                              v-model="doctor.dstatus"
                              @change="doctorFun(doctor)"
                              active-color="#13ce66"
                              inactive-color="#ff4949">
                            </el-switch>  
                          </td>
                      </tr>
                    </table>
                </div>
              </el-tab-pane>
              <el-tab-pane label="预约信息管理">
                <div class="orderManage">
                 <table>
                 <tr>                
                    <td style="width:150px">预约编号</td>
                    <td style="width:150px">姓名</td>
                    <td style="width:150px">疾病</td>
                    <td style="width:150px">预约医生</td>
                    <td style="width:150px">医生工号</td>
                    <td style="width:150px">预约时间</td>
                    <td style="width:150px">状态</td>
               
                   </tr>
                      <tr v-for="order in orders" :key="order.oOid" >
                        <!-- {{order}} -->
                          <td>{{order.ooid}}</td>
                          <td>{{order.uuname}}</td>
                          <td>{{order.bbname}}</td>
                          <td>{{order.ddname}}</td>
                          <td>{{order.djobnum}}</td>
                          <td>{{order.otimes}}</td>
                          <td>{{order.ostatus1}}</td>
                      </tr>
                    </table>
                </div>
              </el-tab-pane>
              <el-tab-pane label="科室信息管理">
              <div class="ksManage">
               <div class="searchh">
                <div class="search"><el-input placeholder="输入要查询的疾病名称" v-model="search"></el-input></div>
                <div class="search1"><el-button @click="getSouSuo()">搜索</el-button></div>
             </div>
             <table>
                  <tr>                
                    <td style="width:60px">科室id</td>
                    <td style="width:100px">科室名</td>
                    <td style="width:100px">疾病id</td>
                    <td style="width:100px">疾病名</td>
                    <td style="width:100px">操作</td>
                   </tr>
                  <tr v-for="jibing in jibings" :key="jibing.bbid" >
                        <!-- {{jibing}} -->
                          <td>{{jibing.kkid}}</td>
                          <td >{{jibing.kkname}}</td>
                          <td >{{jibing.bbid}}</td>
                          <td >{{jibing.bbname}}</td>
                          <td>
                            <el-button type="primary" icon="el-icon-edit" @click="toUpdateJiBing(jibing.bbid)">修改</el-button>
                            <el-button type="primary" icon="el-icon-share" @click="deleteJiBing(jibing.bbid)">删除</el-button>
                          </td>
                  </tr>
                  <div class="bottom">
                  <div class="add">  <el-button type="primary" @click="dialogFormVisible3=true">添加</el-button></div>
                   <div class="pagination">
                        <el-pagination
                                background
                                @size-change="handleSizeChange1"
                                @current-change="handleCurrentChange1"
                                :current-page="pageConf1.pageCode"
                                :page-sizes="pageConf1.pageOption"
                                :page-size="pageConf1.pageSize"
                                layout="total, sizes, prev, pager, next, jumper"
                                :total="pageConf1.totalPage">
                        </el-pagination>
                    </div>
                  </div>
                  </table>
                  
                  <el-dialog title="修改科室信息" :visible.sync="dialogFormVisible2">

                  <el-form :model="jibing">
                    <!-- <el-form-item label="科室ID" :label-width="formLabelWidth">
                      <el-input v-model="jibing.kkid" autocomplete="off" width="200px"></el-input>
                    </el-form-item> -->
                    <el-form-item label="科室名称" :label-width="formLabelWidth">
                      <el-input v-model="jibing.kkname" autocomplete="off"></el-input>
                    </el-form-item>
                     <!-- <el-form-item label="疾病ID" :label-width="formLabelWidth">
                      <el-input v-model="jibing.bbid" autocomplete="off"></el-input>
                    </el-form-item> -->
                     <el-form-item label="疾病名称" :label-width="formLabelWidth">
                      <el-input v-model="jibing.bbname" autocomplete="off"></el-input>
                    </el-form-item>
                  </el-form>
                  <div slot="footer" class="dialog-footer">
                    <el-button @click="dialogFormVisible = false">取 消</el-button>
                    <el-button type="primary" @click="updateJiBing">确 定</el-button>
                  </div>
                </el-dialog>

                 <el-dialog title="添加科室信息" :visible.sync="dialogFormVisible3">
                  <el-form :model="jibing1">
                <div class="ksp">
                  <el-form-item label="科室">
                    <el-select v-model="jibing1.kkid" style="width:450px">
                    <el-option v-for="ks in kss" :key="ks.kkid" :label="ks.kkname" :value="ks.kkid"></el-option>
                  </el-select>
                </el-form-item>
                </div>
                     <el-form-item label="疾病名称" :label-width="formLabelWidth">
                      <el-input v-model="jibing1.bbname" autocomplete="off"  style="width:450px"></el-input>
                    </el-form-item>
                  </el-form>
                  <div slot="footer" class="dialog-footer">
                    <el-button @click="dialogFormVisible = false">取 消</el-button>
                    <el-button type="primary" @click=saveJiBing>确 定</el-button>
                  </div>
                </el-dialog>
                </div>
              </el-tab-pane>
              <el-tab-pane label="留言信息管理">
                <div class="commentManage">
                  <table>
                  <tr>                
                    <td style="width=100px">用户名称</td> 
                     <!-- <td>用户昵称</td> -->
                    <!-- <td>用户地址</td> -->
                    <!-- <td>医生名称</td> -->
                    <td style="width=300px">评论内容</td>
                    <td style="width=100px">评论日期</td>  
                    <td style="width=100px">禁止/发布</td>
                    <td>&nbsp;&nbsp;&nbsp;</td>
                   </tr>
                  <tr v-for="pinglun in pingluns" :key="pinglun.ppid" >
                        <!-- {{ks}} -->
                          <!-- <td>{{pinglun.uname}}</td> -->
                          <td>{{pinglun.unicheng}}</td>
                          <!-- <td>{{pinglun.uaddress}}</td> -->
                          <!-- <td>{{pinglun.ddname}}</td> -->
                          <td>{{pinglun.pcontent}}</td>
                          <td>{{pinglun.pdate}}</td>
                          <td>
                              <el-switch
                              v-model="pinglun.pstatus"
                              @change="pinglunFun(pinglun)"
                              active-color="#13ce66"
                              inactive-color="#ff4949">
                            </el-switch>  
                          </td>
                          <td></td>
                  </tr>
                  </table>
                     <div class="commentpage">
                        <el-pagination
                                background
                                @size-change="handleSizeChange2"
                                @current-change="handleCurrentChange2"
                                :current-page="pageConf2.pageCode"
                                :page-sizes="pageConf2.pageOption"
                                :page-size="pageConf2.pageSize"
                                layout="total, sizes, prev, pager, next, jumper"
                                :total="pageConf2.totalPage">
                        </el-pagination>
              </div>
                </div>
              </el-tab-pane>
            </el-tabs>
            </div>
    </div>
</template>
<script>
  export default {
     data() {
           var validatePass = (rule, value, callback) => {
        if (value === '') {
          callback(new Error('请输入密码'));
        } else {
          if (this.ruleForm.checkPass !== '') {
            this.$refs.ruleForm.validateField('checkPass');
          }
          callback();
        }
      };
      var validatePass2 = (rule, value, callback) => {
        if (value === '') {
          callback(new Error('请再次输入密码'));
        } else if (value !== this.ruleForm.pass) {
          callback(new Error('两次输入密码不一致!'));
        } else {
          callback();
        }
        }
      return {
        search:'',
           ypwd:'',
        ruleForm: {
          pass: '',
          checkPass: '',
        },
        rules: {
          pass: [
            { validator: validatePass, trigger: 'blur' },
            { min: 5, message: '长度在不能小于5个字符' }
          ],
          checkPass: [
            { validator: validatePass2, trigger: 'blur' }
          ],
        },
     //定义分页Config
      pageConf: {
        //设置一些初始值(会被覆盖)
        pageCode: 0, //当前页
        pageSize: 4, //每页显示的记录数
        totalPage: 12, //总记录数
        pageOption: [4, 5, 6], //分页选项
        // handleCurrentChange: function() {
        //   console.log("页码改变了");
        // }
      },
        pageConf1: {
        //设置一些初始值(会被覆盖)
        pageCode: 0, //当前页
        pageSize: 6, //每页显示的记录数
        totalPage: 12, //总记录数
        pageOption: [4, 5 ,6], //分页选项
      },
        pageConf2: {
        //设置一些初始值(会被覆盖)
        pageCode: 0, //当前页
        pageSize: 6, //每页显示的记录数
        totalPage: 12, //总记录数
        pageOption: [4, 5 ,6], //分页选项
      },
        pageConf2: {
        //设置一些初始值(会被覆盖)
        pageCode: 0, //当前页
        pageSize: 4, //每页显示的记录数
        totalPage: 12, //总记录数
        pageOption: [4, 5 ,6], //分页选项
      },
        jibing:{},
        jibing1:{},
        admin:{},
        dialogFormVisible1:false,
        dialogFormVisible2:false,
        dialogFormVisible3:false,
        dialogFormVisible:false,
        formLabelWidth: '120px',
        username:window.localStorage.getItem('aname'),
        users:[],
        admins:[],
        doctors:[],
        orders:[],
        jibings:[],
        pingluns:[],
        kss:[],
        departs:[],
        // user:[u_uid,u_uname,u_sex, u_age, u_address,u_creatdate,u_phonenum,u_email, u_credit,u_status],
        value:true,
        tabPosition: 'left',
        jobnum:window.localStorage.getItem('anum'),
        doctor:{
          ddid:'',
          ddname:'',
          kkid:'',
          dage:'',
          dsex:'',
          dphonenum:'',
          didcard:'',
          dhead:'',
          bbid:'',
          dattend:'',
        },
        admin1:{
          aaid:'',
          aaname:'',
          adepartid:'',
          ajobnum:'',
          apassword:'',
          aphonenum:'',
          astatus:1
          
        },
       
        
      };
    },
    mounted:function(){
       // 关闭浏览器窗口的时候清空浏览器缓存在localStorage的数据
            // window.onbeforeunload = function (e) {
            //     var storage = window.localStorage;
            //     storage.clear()
            // }
      this.getUser();
      this.getAdmin();
      this.getOneAdmin();
      this.getDoctor();
      this.getKs();
      this.getOrder();
      // this.getJibings();
      // this.getJiBing();
      this.getDepart();
      this.getTotalNum();
      this.getTotalNumComment();
     this.findByPage(this.pageConf.pageCode, this.pageConf.pageSize);
     this.findByPageKs(this.pageConf1.pageCode, this.pageConf1.pageSize);
     this.findByPageComment(this.pageConf2.pageCode, this.pageConf2.pageSize);
    //  this.getComment();
    },
    methods: {
      getSouSuo(){
       console.log("要搜索的"+this.search)
         this.$http
        .post("http://"+this.GLOBAL.ipAddress+":8080/jiBing/search",this.search)
        .then(function(data) {
          this.jibings=data.body
         
        });
      },
      pinglunFun(value){
         this.$http
        .post("http://"+this.GLOBAL.ipAddress+":8080/pinglun/update",value)
        .then(function(data) {
          this.pageConf.totalPage = data.body.totalElements;
          this.users = data.body.content;
          // console.log(this.user)
        //  console.log(data.bodyText)
        });
      },
      // getComment(){
      //        this.$http
      //   .get("http://localhost:8080/pinglun/getAll")
      //   .then(function(data) {
      //     this.pingluns = data.body;
      //     // console.log("pingluns"+this.pingluns)
      //   });
      // },
   
      getTotalNum(){
          this.$http
        .get("http://"+this.GLOBAL.ipAddress+":8080/jiBing/getTotalNum")
        .then(function(data) {
          this.pageConf1.totalPage = data.body;
        });
      },
       getTotalNumComment(){
          this.$http
        .get("http://"+this.GLOBAL.ipAddress+":8080/pinglun/getTotalNum")
        .then(function(data) {
          this.pageConf2.totalPage = data.body;
        });
      },
        findByPage: function(pageCode,pageSize) {
      // console.log("页码" + this.pageConf.pageCode);
      // console.log("页数" + this.pageConf.pageSize);
      this.$http
        .get("http://"+this.GLOBAL.ipAddress+":8080/user/findByPage", {params:{pageCode:pageCode,pageSize:pageSize}})
        .then(function(data) {
          this.pageConf.totalPage = data.body.totalElements;
          this.users = data.body.content;
          // console.log(this.user)
        //  console.log(data.bodyText)
        });
    },
        findByPageKs: function(pageCode,pageSize) {
      // console.log("页码" +pageCode);
      // console.log("页数" +pageSize);
      this.$http
        .get("http://"+this.GLOBAL.ipAddress+":8080/jiBing/findByPage", {params:{pageCode:pageCode,pageSize:pageSize}})
        .then(function(data) {
          this.jibings = data.body.content;
        });
    },
       findByPageComment(pageCode,pageSize){
        this.$http
        .get("http://"+this.GLOBAL.ipAddress+":8080/pinglun/findByPage", {params:{pageCode:pageCode,pageSize:pageSize}})
        .then(function(data) {
          this.pingluns = data.body.content;
        });
      },
    //pageSize改变时触发的函数
    handleSizeChange(val) {
       this.pageConf.pageSize=val
      this.findByPage(this.pageConf.pageCode, val);
      console.log("改变每页显示条数"+val)
    },
    //当前页改变时触发的函数
    handleCurrentChange(val) {
      this.findByPage(val-1, this.pageConf.pageSize);
    },
        //pageSize改变时触发的函数
    handleSizeChange1(val) {
       this.pageConf1.pageSize=val
      this.findByPageKs(this.pageConf1.pageCode, val);
      console.log("改变每页显示条数"+val)
    },
    //当前页改变时触发的函数
    handleCurrentChange1(val) {
      console.log("触发改变页数："+val)
      this.findByPageKs(val-1,this.pageConf1.pageSize);
    },
    //pageCode为页数
    //pageSize为条数
       //条数改变时触发的函数
    handleSizeChange2(val) {
      this.pageConf2.pageSize=val
      this.findByPageComment(this.pageConf2.pageCode, val);
      console.log("改变每页显示条数"+val)
    },
    //当前页改变时触发的函数
    handleCurrentChange2(val) {
      console.log("触发改变页数："+val)
      this.findByPageComment(val-1,this.pageConf2.pageSize);
    },

      saveJiBing(){
             this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/jiBing/update",this.jibing1).then(function(data) {
               this.getJibings();
               this.dialogFormVisible3=false
        });

      },
      deleteJiBing(value){
             this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/jiBing/delete",value).then(function(data) {
               this.getJibings();
        });
      },
      getKs(){
            this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/ks/getKs").then(function(data) {
              this.kss=data.body;
              console.log(data.bodyText)
        });
      },
      toUpdateJiBing(value){
          this.dialogFormVisible2=true
            this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/jiBing/getOne",value).then(function(data) {
              this.jibing=data.body;
        });
      },
     updateJiBing(){
            this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/jiBing/update",this.jibing).then(function(data) {
            this.dialogFormVisible2=false
            this.findByPageKs(this.pageConf1.pageCode, this.pageConf1.pageSize);
        });
      },
      getDepart(){
               this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/depart/getAll").then(function(data) {
               this.departs = data.body;
          //  console.log(this.users);
        });
      },
  
      userFun:function(value){
        console.log(value)
         this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/user/updateUser",value)
               .then(function(data){
                   
               })    
      },
       adminFun:function(value){
        // console.log("adminFun"+value)
         this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/admin/updateAdmin",value)
               .then(function(data){
                   
               })    
      },
       doctorFun:function(value){
        // console.log("doctorFun"+value)
         this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/doctor/updateDoctor",value)
               .then(function(data){
                   
               })    
      },
      saveAdmin(){
         this.dialogFormVisible1 = false 
      
        console.log("this.admin1:"+this.admin1)
         this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/admin/updateAdmin",this.admin1)
               .then(function(data){
                //  console.log("data.body"+data.body)
                 this.getAdmin();
               })
      },
      updateAdmin(){

            this.dialogFormVisible = false 
          //  console.log("新密码："+this.anewpwd)
           this.admin1.apassword=this.ruleForm.pass
          //  console.log("要传的密码"+this.admin1.apassword)
              this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/admin/JiaMi",this.ypwd)
               .then(function(data){
                 this.ypwd=data.body;

            if(window.localStorage.getItem('anewpwd')==this.ypwd){
             this.admins.apassword=this.anewpwd
            console.log("修改密码："+this.admin1.apassword)        
               this.$http.post("http://"+this.GLOBAL.ipAddress+":8080/admin/updateAdmin",this.admin1)
               .then(function(data){
                 this.admin1=data.body;
                 alert("请重新登陆")
                  this.$router.push({path:'/Login'});
                  this.loginOut();
               })
               }
               else{
               alert("原密码输入有误")
               this.dialogFormVisible = true 
               }
               })
      },
    
      loginOut(){
        window.localStorage.removeItem('aname')
        window.location.reload
      },
      getUser(){
           this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/user/getUser").then(function(data) {
           this.users = data.body;
          //  console.log(this.users);
        });
      },
      getJiBing(){
            //  console.log("jobnum"+this.jobnum)
           this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/jiBing/getJiBing").then(function(data) {
          //  this.jibings = data.body;
          //  console.log(this.jibings);
        });
      },
         getAdmin(){
          //  console.log("jobnum"+this.jobnum)
           this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/admin/getAdmin").then(function(data) {
           this.admins = data.body;
          //  console.log("this admins"+this.admins);
        });
      },
       getOneAdmin(){
           this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/admin/getOneAdmin?jobNum="+this.jobnum).then(function(data) {
           this.admin2 = data.body;
            // console.log("刚接受的admin"+this.admin2.aaid)
           this.admin1.aaid=this.admin2.aaid;
           this.admin1.aaname= this.admin2.aaname
           this.admin1.adepartid=this.admin2.adepartid
           this.admin1.ajobnum=this.admin2.ajobnum
           window.localStorage.setItem('ypwd',this.admin2.apassword)
           this.admin1.aphonenum=this.admin2.aphonenum
           
        });
      },
      getDoctor(){
           this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/doctor/getDoctor").then(function(data) {
           this.doctors = data.body;
           console.log(this.doctors);
        });
      },
      getOrder(){
           this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/order/getOrder").then(function(data) {
           this.orders = data.body;
          //  console.log(this.orders);
        });
      },
         getJibings(){
           this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/jiBing/getAll").then(function(data) {
          //  this.jibings = data.body;
           console.log(this.jibings);
        });
      },
      // changeStatus(){
      //  this.$http.get("http://localhost:8080/user/update").then(function(data) {
       
      //  });
      // },
      handleOpen(key, keyPath) {
        // console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        // console.log(key, keyPath);
      },
      deleteAdmin(){
          this.$http.get("http://"+this.GLOBAL.ipAddress+":8080/Admin/deleteAdmin",this.user).then(function(data) {
           this.users = data.body;
          //  console.log(data.body);
        });
      }
    }
  }
</script>
<style scoped>
.bottom{
  /* border: 1px solid rebeccapurple; */
  height: 60px;
  position: relative;
}
.pagination{
  position: absolute;
  left: 300px;
   width: 500px;
   float: left;
   /* border: 1px red solid; */
}
.add{
  position: absolute;
width: 100px;
float: left;
/* border: 1px red solid; */
}
.ksp{
  margin-left: 70px;
}
.router-link-active {
  text-decoration: none;
}
a{
  text-decoration: none;
}
table{
  background-color: white;
  width: 1370px;
  margin-top: 10px;
  margin-left: 8px;
  /* margin-right: 8px; */
  border-collapse: collapse;
  color:#9e9e9e;
  font-size: 15px;
  font-weight: bold;
}
tr{
  height: 50px;
  border:1px solid #e0e0e0;
}

body{
  margin: 0px;
  padding: 0px;
}
  .header{
    background-color:#0097a7;
    height: 100px;
    font-size: 26px;
    padding-top: 45px;
    padding-left: 35px;
     position: relative;
     color: white;
  }
  .main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    /* line-height: 300px; */
    height: 450px;
    /* font-size: 30px; */
  }
  body > .el-container {
    margin-bottom: 40px;
  }

  .manage{
    /* margin-bottom: 10px; */
    height: 90px;
    width: 200px;
    line-height: 90px;
    /* background-color: brown; */
    font-size: 20px;
    border: 1px grey solid;
  }
   .sys{
    font-weight:800;
    float: left;
    position:absolute;
    left: 40px;
  }
  .admin{
    top: 70px;
     float: left;
     margin-right: 10px;
     position: absolute;
     right: 20px;
     font-size: 18px;
  }
  .adminPict{
    float: left;
    height: 30px;
    width: 50px;
  }
  .adminName{
    float: left;
    margin-right: 16px;
  }
  .adminExit{
    float: left;
  }
  .userManage{
    height: 460px;
    width: 1200px;
    line-height: 40px;
  }
  .searchh{
   
  }
  .search{
    margin-left: 20px;
   float: left;
  }
  .search1{
   float: left;
  }

</style>
